home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / boot / WBSP_Prefs.lha / WBStartup+Prefs / Source / CheckBoxListView.c < prev    next >
C/C++ Source or Header  |  2002-03-06  |  1KB  |  48 lines

  1. #include <exec/types.h>
  2. #include <exec/lists.h>
  3. #include <intuition/classusr.h>
  4. #include <proto/utility.h>
  5. #include <string.h>
  6.  
  7. #include "CheckBoxListView.h"
  8.  
  9. #include "WBStartup+Prefs.h"
  10. #include "WBStartupPlusPrefs_cat.h"
  11.  
  12. ULONG __saveds __asm LVDisplay(register __a1 struct WBSPNode *node,register __a2 char **array)
  13. {
  14.     static char prioritystring[10];
  15.     if (node)
  16.     {
  17.         if (node->wbsp_type)
  18.             *array++="\33o[00000002]";
  19.         else
  20.             *array++="\33o[00000001]";
  21.         *array++=node->wbsp_name;
  22.         stci_d(prioritystring,(int)node->wbsp_pri);
  23.         *array=prioritystring;
  24.  
  25.     }
  26.     else
  27.     {
  28.         *array++=NULL;
  29.         *array++=GetString(STRProgramName);
  30.         *array=GetString(STRPriority);
  31.     }
  32.     return(0);
  33. }
  34.  
  35. LONG __saveds __asm LVCompare(register __a1 struct WBSPNode *node1,register __a2 struct WBSPNode *node2)
  36. {
  37.     LONG Result1,Result2;
  38.     Result1=Stricmp(node1->wbsp_name,node2->wbsp_name);
  39.     Result2=node2->wbsp_pri-node1->wbsp_pri;
  40.     if (prefs.Alphabetize && Result1)
  41.         return(Result1);
  42.     else
  43.         if (Result2)
  44.             return(Result2);
  45.         else
  46.             return(Result1);
  47. }
  48.